<template>
	<view>
		<view class="pusher-wrap">
			<view class="pusher-text">发放金额： {{total.ffje}}元</view>
			<view class="pusher-text">发放个数： {{total.ffgs}}</view>
			<view class="pusher-text">未发放金额： {{total.wffje}}元</view>
			<view class="pusher-text">未发放个数： {{total.wffgs}}</view>
			
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				mainid:'',
				phone:'',
				total:{
					ffje:'',
					ffgs:'',
					wffje:'',
					wffgs:'',
				}
			}
		},
		onLoad() {
			uni.getStorage({
				key: 'user',
				success: (res) => {
					this.mainid = res.data.id;
					this.getRedYesterday()
				}
			});
			
		},
		methods: {
			getRedYesterday() {
				uni.request({
					header: {
						'Content-Type': 'application/x-www-form-urlencoded', //自定义请求头信息
					},
					url: getApp().globalData.url + 'mch/getRedYesterday/' + this.mainid, //仅为示例，并非真实接口地址。
					method: 'POST',
					data: {
						"id": this.mainid,
					},
					success: (res) => {
						console.log('getRedYesterday：',res);
						
						if (res.data.status == '200') {
							this.total = res.data.data
						} else {
							uni.showToast({
								title: res.data.msg,
								icon: 'none',
								duration: 2000
							});
						}
					},
					fail: (error) => {
						// this.checks = true
						console.log(error)
					}
				});
			},
		}
	}
</script>

<style>
	
	.pusher-wrap{
		background-color: white;
		margin: 30upx;
		padding: 30upx;
		border-radius: 8upx;
	}
	.pusher-text{
		font-size: 34upx;
		padding: 10upx 0;
	}
</style>
